
             
/**
 * 
 *
 * @File name:  AddTFixedAssetsAction.java   添加【资产基本信息:T_FIXED_ASSETS】
 * @Create on:  2011-10-31 17:00:991
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.assetsbase.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.common.SystemUtils;
import com.boho.estates.po.TFixedAssetsPO;

public class AddTFixedAssetsAction extends ActionImp {
	private TFixedAssetsPO tFixedAssetsPO = new TFixedAssetsPO();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1001", MessageService.getMessage("BOHO_COMMON_1001"),"【资产基本信息】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		POUtils.insert(con, tFixedAssetsPO,false);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		String createBy = SystemUtils.getSessionUser(atx);
		tFixedAssetsPO.setFixedAssetsName(atx.getStringValue("FIXED_ASSETS_NAME"));
		tFixedAssetsPO.setFixedAssetsType(atx.getStringValue("FIXED_ASSETS_TYPE"));
		tFixedAssetsPO.setBrand(atx.getStringValue("BRAND"));
		tFixedAssetsPO.setFixedAssetsNature(atx.getStringValue("FIXED_ASSETS_NATURE"));
		tFixedAssetsPO.setRemark(atx.getStringValue("REMARK"));
		tFixedAssetsPO.setCreateDate(new java.util.Date());
		tFixedAssetsPO.setCreateBy(createBy);
		return 1;
	}
}
